3.192 \(\int \frac{\sec (e+f x) (a+a \sec (e+f x))}{(c+d \sec (e+f x))^4} \, dx\)

Optimal. Leaf size=189 \[ \frac{a \left (2 c^2-2 c d+d^2\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{f (c-d)^{5/2} (c+d)^{7/2}}+\frac{a (c-4 d) (2 c-d) \tan (e+f x)}{6 f (c-d)^2 (c+d)^3 (c+d \sec (e+f x))}+\frac{a (2 c-3 d) \tan (e+f x)}{6 f (c-d) (c+d)^2 (c+d \sec (e+f x))^2}+\frac{a \tan (e+f x)}{3 f (c+d) (c+d \sec (e+f x))^3} \]

[Out]

(a*(2*c^2 - 2*c*d + d^2)*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/((c - d)^(5/2)*(c + d)^(7/2)*f)
+ (a*Tan[e + f*x])/(3*(c + d)*f*(c + d*Sec[e + f*x])^3) + (a*(2*c - 3*d)*Tan[e + f*x])/(6*(c - d)*(c + d)^2*f*
(c + d*Sec[e + f*x])^2) + (a*(c - 4*d)*(2*c - d)*Tan[e + f*x])/(6*(c - d)^2*(c + d)^3*f*(c + d*Sec[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.454203, antiderivative size = 189, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {4003, 12, 3831, 2659, 208} \[ \frac{a \left (2 c^2-2 c d+d^2\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{f (c-d)^{5/2} (c+d)^{7/2}}+\frac{a (c-4 d) (2 c-d) \tan (e+f x)}{6 f (c-d)^2 (c+d)^3 (c+d \sec (e+f x))}+\frac{a (2 c-3 d) \tan (e+f x)}{6 f (c-d) (c+d)^2 (c+d \sec (e+f x))^2}+\frac{a \tan (e+f x)}{3 f (c+d) (c+d \sec (e+f x))^3} \]

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(a + a*Sec[e + f*x]))/(c + d*Sec[e + f*x])^4,x]

[Out]

(a*(2*c^2 - 2*c*d + d^2)*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/((c - d)^(5/2)*(c + d)^(7/2)*f)
+ (a*Tan[e + f*x])/(3*(c + d)*f*(c + d*Sec[e + f*x])^3) + (a*(2*c - 3*d)*Tan[e + f*x])/(6*(c - d)*(c + d)^2*f*
(c + d*Sec[e + f*x])^2) + (a*(c - 4*d)*(2*c - d)*Tan[e + f*x])/(6*(c - d)^2*(c + d)^3*f*(c + d*Sec[e + f*x]))

Rule 4003

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_))
, x_Symbol] :> -Simp[((A*b - a*B)*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 - b^2)), x] + Dis
t[1/((m + 1)*(a^2 - b^2)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*Simp[(a*A - b*B)*(m + 1) - (A*b - a*B
)*(m + 2)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] &
& LtQ[m, -1]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sec (e+f x) (a+a \sec (e+f x))}{(c+d \sec (e+f x))^4} \, dx &=\frac{a \tan (e+f x)}{3 (c+d) f (c+d \sec (e+f x))^3}-\frac{\int \frac{\sec (e+f x) (-3 a (c-d)-2 a (c-d) \sec (e+f x))}{(c+d \sec (e+f x))^3} \, dx}{3 \left (c^2-d^2\right )}\\ &=\frac{a \tan (e+f x)}{3 (c+d) f (c+d \sec (e+f x))^3}+\frac{a (2 c-3 d) \tan (e+f x)}{6 (c-d) (c+d)^2 f (c+d \sec (e+f x))^2}+\frac{\int \frac{\sec (e+f x) (2 a (3 c-2 d) (c-d)+a (2 c-3 d) (c-d) \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx}{6 \left (c^2-d^2\right )^2}\\ &=\frac{a \tan (e+f x)}{3 (c+d) f (c+d \sec (e+f x))^3}+\frac{a (2 c-3 d) \tan (e+f x)}{6 (c-d) (c+d)^2 f (c+d \sec (e+f x))^2}+\frac{a (c-4 d) (2 c-d) \tan (e+f x)}{6 (c-d)^2 (c+d)^3 f (c+d \sec (e+f x))}-\frac{\int -\frac{3 a (c-d) \left (2 c^2-2 c d+d^2\right ) \sec (e+f x)}{c+d \sec (e+f x)} \, dx}{6 \left (c^2-d^2\right )^3}\\ &=\frac{a \tan (e+f x)}{3 (c+d) f (c+d \sec (e+f x))^3}+\frac{a (2 c-3 d) \tan (e+f x)}{6 (c-d) (c+d)^2 f (c+d \sec (e+f x))^2}+\frac{a (c-4 d) (2 c-d) \tan (e+f x)}{6 (c-d)^2 (c+d)^3 f (c+d \sec (e+f x))}+\frac{\left (a \left (2 c^2-2 c d+d^2\right )\right ) \int \frac{\sec (e+f x)}{c+d \sec (e+f x)} \, dx}{2 (c-d)^2 (c+d)^3}\\ &=\frac{a \tan (e+f x)}{3 (c+d) f (c+d \sec (e+f x))^3}+\frac{a (2 c-3 d) \tan (e+f x)}{6 (c-d) (c+d)^2 f (c+d \sec (e+f x))^2}+\frac{a (c-4 d) (2 c-d) \tan (e+f x)}{6 (c-d)^2 (c+d)^3 f (c+d \sec (e+f x))}+\frac{\left (a \left (2 c^2-2 c d+d^2\right )\right ) \int \frac{1}{1+\frac{c \cos (e+f x)}{d}} \, dx}{2 (c-d)^2 d (c+d)^3}\\ &=\frac{a \tan (e+f x)}{3 (c+d) f (c+d \sec (e+f x))^3}+\frac{a (2 c-3 d) \tan (e+f x)}{6 (c-d) (c+d)^2 f (c+d \sec (e+f x))^2}+\frac{a (c-4 d) (2 c-d) \tan (e+f x)}{6 (c-d)^2 (c+d)^3 f (c+d \sec (e+f x))}+\frac{\left (a \left (2 c^2-2 c d+d^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{c}{d}+\left (1-\frac{c}{d}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{(c-d)^2 d (c+d)^3 f}\\ &=\frac{a \left (2 c^2-2 c d+d^2\right ) \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{(c-d)^{5/2} (c+d)^{7/2} f}+\frac{a \tan (e+f x)}{3 (c+d) f (c+d \sec (e+f x))^3}+\frac{a (2 c-3 d) \tan (e+f x)}{6 (c-d) (c+d)^2 f (c+d \sec (e+f x))^2}+\frac{a (c-4 d) (2 c-d) \tan (e+f x)}{6 (c-d)^2 (c+d)^3 f (c+d \sec (e+f x))}\\ \end{align*}

Mathematica [A]  time = 3.18907, size = 247, normalized size = 1.31 \[ -\frac{a (\cos (e+f x)+1) \sec ^2\left (\frac{1}{2} (e+f x)\right ) \left (6 \left (2 c^2-2 c d+d^2\right ) (c \cos (e+f x)+d)^3 \tanh ^{-1}\left (\frac{(d-c) \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c^2-d^2}}\right )-\frac{1}{2} \sqrt{c^2-d^2} \sin (e+f x) \left (6 d \left (-7 c^2 d+2 c^3+2 c d^2+d^3\right ) \cos (e+f x)+\left (-2 c^2 d^2-12 c^3 d+6 c^4+3 c d^3+2 d^4\right ) \cos (2 (e+f x))+2 c^2 d^2-12 c^3 d+6 c^4-15 c d^3+10 d^4\right )\right )}{12 f (c-d)^2 (c+d)^3 \sqrt{c^2-d^2} (c \cos (e+f x)+d)^3} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x]))/(c + d*Sec[e + f*x])^4,x]

[Out]

-(a*(1 + Cos[e + f*x])*Sec[(e + f*x)/2]^2*(6*(2*c^2 - 2*c*d + d^2)*ArcTanh[((-c + d)*Tan[(e + f*x)/2])/Sqrt[c^
2 - d^2]]*(d + c*Cos[e + f*x])^3 - (Sqrt[c^2 - d^2]*(6*c^4 - 12*c^3*d + 2*c^2*d^2 - 15*c*d^3 + 10*d^4 + 6*d*(2
*c^3 - 7*c^2*d + 2*c*d^2 + d^3)*Cos[e + f*x] + (6*c^4 - 12*c^3*d - 2*c^2*d^2 + 3*c*d^3 + 2*d^4)*Cos[2*(e + f*x
)])*Sin[e + f*x])/2))/(12*(c - d)^2*(c + d)^3*Sqrt[c^2 - d^2]*f*(d + c*Cos[e + f*x])^3)

________________________________________________________________________________________

Maple [A]  time = 0.117, size = 271, normalized size = 1.4 \begin{align*} 4\,{\frac{a}{f} \left ({\frac{1}{ \left ( \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}c- \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}d-c-d \right ) ^{3}} \left ( -1/4\,{\frac{ \left ( 2\,{c}^{2}-2\,cd+{d}^{2} \right ) \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{5}}{{c}^{3}+3\,{c}^{2}d+3\,{d}^{2}c+{d}^{3}}}+1/3\,{\frac{ \left ( 3\,{c}^{2}-6\,cd+{d}^{2} \right ) \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{3}}{ \left ( c-d \right ) \left ({c}^{2}+2\,cd+{d}^{2} \right ) }}-1/4\,{\frac{ \left ( 2\,{c}^{2}-6\,cd+3\,{d}^{2} \right ) \tan \left ( 1/2\,fx+e/2 \right ) }{ \left ( c+d \right ) \left ({c}^{2}-2\,cd+{d}^{2} \right ) }} \right ) }+1/4\,{\frac{2\,{c}^{2}-2\,cd+{d}^{2}}{ \left ({c}^{5}+{c}^{4}d-2\,{c}^{3}{d}^{2}-2\,{c}^{2}{d}^{3}+c{d}^{4}+{d}^{5} \right ) \sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^4,x)

[Out]

4/f*a*((-1/4*(2*c^2-2*c*d+d^2)/(c^3+3*c^2*d+3*c*d^2+d^3)*tan(1/2*f*x+1/2*e)^5+1/3*(3*c^2-6*c*d+d^2)/(c-d)/(c^2
+2*c*d+d^2)*tan(1/2*f*x+1/2*e)^3-1/4*(2*c^2-6*c*d+3*d^2)/(c+d)/(c^2-2*c*d+d^2)*tan(1/2*f*x+1/2*e))/(tan(1/2*f*
x+1/2*e)^2*c-tan(1/2*f*x+1/2*e)^2*d-c-d)^3+1/4*(2*c^2-2*c*d+d^2)/(c^5+c^4*d-2*c^3*d^2-2*c^2*d^3+c*d^4+d^5)/((c
+d)*(c-d))^(1/2)*arctanh(tan(1/2*f*x+1/2*e)*(c-d)/((c+d)*(c-d))^(1/2)))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^4,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 0.691661, size = 2731, normalized size = 14.45 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^4,x, algorithm="fricas")

[Out]

[1/12*(3*(2*a*c^2*d^3 - 2*a*c*d^4 + a*d^5 + (2*a*c^5 - 2*a*c^4*d + a*c^3*d^2)*cos(f*x + e)^3 + 3*(2*a*c^4*d -
2*a*c^3*d^2 + a*c^2*d^3)*cos(f*x + e)^2 + 3*(2*a*c^3*d^2 - 2*a*c^2*d^3 + a*c*d^4)*cos(f*x + e))*sqrt(c^2 - d^2
)*log((2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 + 2*sqrt(c^2 - d^2)*(d*cos(f*x + e) + c)*sin(f*x + e)
 + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2)) + 2*(2*a*c^4*d^2 - 9*a*c^3*d^3 + 2*a*c^2*d^4
+ 9*a*c*d^5 - 4*a*d^6 + (6*a*c^6 - 12*a*c^5*d - 8*a*c^4*d^2 + 15*a*c^3*d^3 + 4*a*c^2*d^4 - 3*a*c*d^5 - 2*a*d^6
)*cos(f*x + e)^2 + 3*(2*a*c^5*d - 7*a*c^4*d^2 + 8*a*c^2*d^4 - 2*a*c*d^5 - a*d^6)*cos(f*x + e))*sin(f*x + e))/(
(c^10 + c^9*d - 3*c^8*d^2 - 3*c^7*d^3 + 3*c^6*d^4 + 3*c^5*d^5 - c^4*d^6 - c^3*d^7)*f*cos(f*x + e)^3 + 3*(c^9*d
 + c^8*d^2 - 3*c^7*d^3 - 3*c^6*d^4 + 3*c^5*d^5 + 3*c^4*d^6 - c^3*d^7 - c^2*d^8)*f*cos(f*x + e)^2 + 3*(c^8*d^2
+ c^7*d^3 - 3*c^6*d^4 - 3*c^5*d^5 + 3*c^4*d^6 + 3*c^3*d^7 - c^2*d^8 - c*d^9)*f*cos(f*x + e) + (c^7*d^3 + c^6*d
^4 - 3*c^5*d^5 - 3*c^4*d^6 + 3*c^3*d^7 + 3*c^2*d^8 - c*d^9 - d^10)*f), 1/6*(3*(2*a*c^2*d^3 - 2*a*c*d^4 + a*d^5
 + (2*a*c^5 - 2*a*c^4*d + a*c^3*d^2)*cos(f*x + e)^3 + 3*(2*a*c^4*d - 2*a*c^3*d^2 + a*c^2*d^3)*cos(f*x + e)^2 +
 3*(2*a*c^3*d^2 - 2*a*c^2*d^3 + a*c*d^4)*cos(f*x + e))*sqrt(-c^2 + d^2)*arctan(-sqrt(-c^2 + d^2)*(d*cos(f*x +
e) + c)/((c^2 - d^2)*sin(f*x + e))) + (2*a*c^4*d^2 - 9*a*c^3*d^3 + 2*a*c^2*d^4 + 9*a*c*d^5 - 4*a*d^6 + (6*a*c^
6 - 12*a*c^5*d - 8*a*c^4*d^2 + 15*a*c^3*d^3 + 4*a*c^2*d^4 - 3*a*c*d^5 - 2*a*d^6)*cos(f*x + e)^2 + 3*(2*a*c^5*d
 - 7*a*c^4*d^2 + 8*a*c^2*d^4 - 2*a*c*d^5 - a*d^6)*cos(f*x + e))*sin(f*x + e))/((c^10 + c^9*d - 3*c^8*d^2 - 3*c
^7*d^3 + 3*c^6*d^4 + 3*c^5*d^5 - c^4*d^6 - c^3*d^7)*f*cos(f*x + e)^3 + 3*(c^9*d + c^8*d^2 - 3*c^7*d^3 - 3*c^6*
d^4 + 3*c^5*d^5 + 3*c^4*d^6 - c^3*d^7 - c^2*d^8)*f*cos(f*x + e)^2 + 3*(c^8*d^2 + c^7*d^3 - 3*c^6*d^4 - 3*c^5*d
^5 + 3*c^4*d^6 + 3*c^3*d^7 - c^2*d^8 - c*d^9)*f*cos(f*x + e) + (c^7*d^3 + c^6*d^4 - 3*c^5*d^5 - 3*c^4*d^6 + 3*
c^3*d^7 + 3*c^2*d^8 - c*d^9 - d^10)*f)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} a \left (\int \frac{\sec{\left (e + f x \right )}}{c^{4} + 4 c^{3} d \sec{\left (e + f x \right )} + 6 c^{2} d^{2} \sec ^{2}{\left (e + f x \right )} + 4 c d^{3} \sec ^{3}{\left (e + f x \right )} + d^{4} \sec ^{4}{\left (e + f x \right )}}\, dx + \int \frac{\sec ^{2}{\left (e + f x \right )}}{c^{4} + 4 c^{3} d \sec{\left (e + f x \right )} + 6 c^{2} d^{2} \sec ^{2}{\left (e + f x \right )} + 4 c d^{3} \sec ^{3}{\left (e + f x \right )} + d^{4} \sec ^{4}{\left (e + f x \right )}}\, dx\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e))**4,x)

[Out]

a*(Integral(sec(e + f*x)/(c**4 + 4*c**3*d*sec(e + f*x) + 6*c**2*d**2*sec(e + f*x)**2 + 4*c*d**3*sec(e + f*x)**
3 + d**4*sec(e + f*x)**4), x) + Integral(sec(e + f*x)**2/(c**4 + 4*c**3*d*sec(e + f*x) + 6*c**2*d**2*sec(e + f
*x)**2 + 4*c*d**3*sec(e + f*x)**3 + d**4*sec(e + f*x)**4), x))

________________________________________________________________________________________

Giac [B]  time = 1.50392, size = 632, normalized size = 3.34 \begin{align*} -\frac{\frac{3 \,{\left (2 \, a c^{2} - 2 \, a c d + a d^{2}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-c^{2} + d^{2}}}\right )\right )}}{{\left (c^{5} + c^{4} d - 2 \, c^{3} d^{2} - 2 \, c^{2} d^{3} + c d^{4} + d^{5}\right )} \sqrt{-c^{2} + d^{2}}} + \frac{6 \, a c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} - 18 \, a c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 21 \, a c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} - 12 \, a c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} + 3 \, a d^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{5} - 12 \, a c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 24 \, a c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 8 \, a c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 24 \, a c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 4 \, a d^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 6 \, a c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 6 \, a c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 21 \, a c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 9 \, a d^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{{\left (c^{5} + c^{4} d - 2 \, c^{3} d^{2} - 2 \, c^{2} d^{3} + c d^{4} + d^{5}\right )}{\left (c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - c - d\right )}^{3}}}{3 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^4,x, algorithm="giac")

[Out]

-1/3*(3*(2*a*c^2 - 2*a*c*d + a*d^2)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*c - 2*d) + arctan((c*tan(1/2*f*x +
 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^2 + d^2)))/((c^5 + c^4*d - 2*c^3*d^2 - 2*c^2*d^3 + c*d^4 + d^5)*sqrt
(-c^2 + d^2)) + (6*a*c^4*tan(1/2*f*x + 1/2*e)^5 - 18*a*c^3*d*tan(1/2*f*x + 1/2*e)^5 + 21*a*c^2*d^2*tan(1/2*f*x
 + 1/2*e)^5 - 12*a*c*d^3*tan(1/2*f*x + 1/2*e)^5 + 3*a*d^4*tan(1/2*f*x + 1/2*e)^5 - 12*a*c^4*tan(1/2*f*x + 1/2*
e)^3 + 24*a*c^3*d*tan(1/2*f*x + 1/2*e)^3 + 8*a*c^2*d^2*tan(1/2*f*x + 1/2*e)^3 - 24*a*c*d^3*tan(1/2*f*x + 1/2*e
)^3 + 4*a*d^4*tan(1/2*f*x + 1/2*e)^3 + 6*a*c^4*tan(1/2*f*x + 1/2*e) - 6*a*c^3*d*tan(1/2*f*x + 1/2*e) - 21*a*c^
2*d^2*tan(1/2*f*x + 1/2*e) + 9*a*d^4*tan(1/2*f*x + 1/2*e))/((c^5 + c^4*d - 2*c^3*d^2 - 2*c^2*d^3 + c*d^4 + d^5
)*(c*tan(1/2*f*x + 1/2*e)^2 - d*tan(1/2*f*x + 1/2*e)^2 - c - d)^3))/f